<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
    <tabbar v-if="tabType" ></tabbar>
  </div>
</template>

<script>

import Tabbar from "./components/common/tabbar.vue";

export default {
  name: 'App',
  components: {Tabbar},

  data() {
    return {
      isRouterAlive: true,
      tabType: true,
    }
  },

  provide () {
    return {
      reload: this.reload
    }
  },

  methods: {
    reload() {
      this.isRouterAlive = false;
      this.$nextTick(function (){
        this.isRouterAlive = true
      })
    }
  },


  watch: {
    $route(to, from) {
      if (to.name === 'Home' || to.name === 'Mine') {
        this.tabType = true
      } else {
        this.tabType = false
      }

    },
  }
}


</script>

<style>
#app {

}
</style>
